From 3a7e3cf90d265330e0dc75d733b5be19c8b617c6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Feb 2020 18:43:45 +0100 Subject: [PATCH] dragdest: Simplify function Make it obvious that the functions checks one condition and then the other. --- gtk/gtkdragdest.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c index 9d8489d45e..65d6faad75 100644 --- a/gtk/gtkdragdest.c +++ b/gtk/gtkdragdest.c @@ -564,14 +564,10 @@ static gboolean gtk_drop_target_accept (GtkDropTarget *dest, GdkDrop *drop) { - GdkDragAction dest_actions; - GdkDragAction actions; - - dest_actions = gtk_drop_target_get_actions (dest); - - actions = dest_actions & gdk_drop_get_actions (drop); + if ((gdk_drop_get_actions (drop) & gtk_drop_target_get_actions (dest)) == 0) + return FALSE; - return actions && gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop)); + return gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop)); } static void -- 2.30.2